#include "defs.h"
#include <fstream>
#include <string>
using namespace std;

void LoadRaw(string rawfiles,char** inFile,size_t size)
{
	ifstream fin(rawfiles,fstream::in|fstream::binary);
	if(!fin){
		ERRBOX("Read Files Failed\n");
	}
	fin.read((char*)&(*inFile)[0],(streamsize)size);
	fin.close();
}

void RandomizePos(vector<D3DXVECTOR3>& vecPos,DWORD dwNum)
{
	if(vecPos.size()<=0)
		ERRBOX("WTF!WHERE'S YOUR POS\n");
	srand(unsigned(time(0)));
	size_t size = vecPos.size();
	for(int i = 0;i!=dwNum;++i)
	{
		swap(vecPos[i],vecPos[i+rand()%(size-i)]);
	}
}